ChatMessage

@Serializable
data class ChatMessage(val sender: Sender = Sender.Null, val message: String = "", var createdAt: Date? = null)

Represents a single chat message in a conversation. A ChatMessage consists of the sender (either bot or user), the message content, and the timestamp of when the message was created.

Constructors

Link copied to clipboard
constructor(sender: Sender = Sender.Null, message: String = "", createdAt: Date? = null)

Properties

Link copied to clipboard
@Serializable(with = DateSerializer::class)
var createdAt: Date?

The timestamp when the message was created.

Link copied to clipboard

The actual content of the message.

Link copied to clipboard

Indicates whether the message is from the user or the bot.